Skip to content

Implement LinksBot for Telegram with cleaner code and enhanced features - #322

Open
konard wants to merge 3 commits into
mainfrom
issue-68-e8d16f1d
Open

Implement LinksBot for Telegram with cleaner code and enhanced features#322
konard wants to merge 3 commits into
mainfrom
issue-68-e8d16f1d

Conversation

@konard

@konard konard commented Sep 13, 2025

Copy link
Copy Markdown
Member

🚀 LinksBot for Telegram Implementation

This PR implements a complete, modern Telegram bot for the LinksPlattform community with cleaner code and enhanced features as requested in #68.

📋 Issue Reference

Fixes #68

✨ Features Implemented

Core Functionality:

  • ✅ Complete Telegram bot using aiogram 3.x framework
  • ✅ JSON-based data storage (no SQL dependencies as requested)
  • ✅ Async/await architecture with full type hints
  • ✅ Modular, maintainable code structure

User Features:

  • ✅ User profile management with programming languages (130+ supported)
  • ✅ Karma system with community-driven voting
  • ✅ GitHub profile integration
  • ✅ Wikipedia search functionality
  • ✅ Group chat support with member management

Technical Features:

  • ✅ Command-based interface (/help, /info, /karma, /top, etc.)
  • ✅ Reply-based karma voting with + and - messages
  • ✅ Karma cooldown system based on user reputation
  • ✅ Data persistence using JSON files
  • ✅ Comprehensive test suite
  • ✅ Setup scripts for easy deployment
  • ✅ Full documentation and README

🏗️ Architecture

The implementation follows clean architecture principles:

telegram/
├── main.py              # Bot initialization and routing
├── config.py            # Configuration (from template)
├── modules/
│   ├── storage.py       # JSON-based data persistence
│   └── commands.py      # Command handlers and business logic
├── README.md            # Complete documentation
├── requirements.txt     # Dependencies
├── setup.py            # Setup script
└── test files          # Test suite

🔧 Key Design Decisions

  1. No SQL Dependencies: Following project preferences, uses simple JSON file storage
  2. Modern Python: Full async/await with aiogram 3.x and type hints
  3. Modular Design: Separated concerns for storage, commands, and bot logic
  4. Community Features: Karma system with voting cooldowns based on reputation
  5. Comprehensive Testing: Full test suite ensuring reliability

🎯 Karma System

  • Positive karma: 2 votes needed to increase karma by 1
  • Negative karma: 3 votes needed to decrease karma by 1
  • Cooldown periods: Based on user karma level (30 min to 8 hours)
  • Protection: Users with negative karma cannot be voted down further

📚 Supported Programming Languages

130+ languages including: Python, JavaScript, TypeScript, Java, C++, C#, Go, Rust, PHP, Ruby, Swift, Kotlin, F#, Scala, Haskell, and many more specialized languages.

🚀 Deployment

  1. Install dependencies: pip install -r telegram/requirements.txt
  2. Configure: Copy config.template.py to config.py and set bot token
  3. Run setup: python telegram/setup.py
  4. Start bot: python telegram/main.py

🧪 Testing

  • ✅ Core functionality tests pass
  • ✅ Storage operations verified
  • ✅ Command logic validated
  • ✅ Data persistence confirmed

Run tests: python telegram/simple_test.py

📖 Documentation

Complete README with:

  • Feature overview and command list
  • Installation and configuration guide
  • Architecture documentation
  • Contributing guidelines

💡 Future Enhancements

The modular architecture supports easy addition of:

  • GitHub Copilot integration
  • Additional command handlers
  • Extended karma features
  • More data export formats

This implementation provides all requested features while maintaining clean, modern code that follows project conventions and avoids SQL dependencies.

🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #68
@konard konard self-assigned this Sep 13, 2025
- Add complete Telegram bot implementation using aiogram 3.x
- Implement JSON-based storage system (no SQL dependencies as requested)
- Support for all core features from VK bot:
  * User profiles with programming languages
  * Karma system with community voting
  * GitHub profile integration
  * Wikipedia search functionality
  * Group chat support with member management
- Modern async/await architecture with type hints
- Comprehensive test suite and setup scripts
- Full documentation and README
- Configuration template for easy deployment

Features:
- 130+ programming languages supported
- Karma voting with cooldown system based on user reputation
- JSON file persistence for user data and voting history
- Command-based interface with /help, /info, /karma, /top, etc.
- Reply-based karma voting with + and - messages
- Modular architecture for easy maintenance and extension

The implementation follows the project's preference for avoiding SQL
databases and provides a clean, maintainable codebase for Telegram.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] LinksBot for Telegram! Implement LinksBot for Telegram with cleaner code and enhanced features Sep 13, 2025
@konard
konard marked this pull request as ready for review September 13, 2025 18:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LinksBot for Telegram!

1 participant